﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="goodsDetail.aspx.cs" Inherits="WebSite.cn.goodsDetail" %>

<%@ Register Src="head.ascx" TagName="head" TagPrefix="uc1" %>
<%@ Register Src="category.ascx" TagName="category" TagPrefix="uc2" %>
<%@ Register Src="bottom.ascx" TagName="bottom" TagPrefix="uc3" %>
<%@ Register src="browesProduct.ascx" tagname="browesProduct" tagprefix="uc4" %>
<%@ Register src="leftimgs.ascx" tagname="leftimgs" tagprefix="uc5" %>
<%@ Register src="../Controls/leftRelationGoods.ascx" tagname="leftRelationGoods" tagprefix="uc6" %>
<%@ Register src="../Controls/leftHotGoods.ascx" tagname="leftHotGoods" tagprefix="uc7" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
 <title><%=WebSite.info.info1("", "shoptitle")%></title>
    <meta name="Description" content="<%=WebSite.info.info1("","shopcontent")%>" /> 
    <meta name="Keywords" content="<%=WebSite.info.info1("","shopkey")%>" />
     <link href="/cn/css/goods_detail.css" type="text/css" rel="stylesheet" />
         <link href="/cn/css/jqzoom.css" type="text/css" rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<uc1:head ID="head_1" runat="server" />

<script type="text/javascript" src="/js/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="/js/goodsDetailSilide.js"></script>
    <center>
     <div class="page_navigater">
			<p><a href="/cn/index.aspx">首页</a>><%=SbNavigater.ToString()%></p>
	  </div>
      </center>

<div class="container">

<div class="main">
<div class="goodsuct_box">
<div class="pic-slider">

<div class="pic-slider">
<ul id="mycarousel" class="jcarousel-skin-mds">
  
  <%= SbImagesHtml.ToString() %>

</ul>
<div class="pics"></div></div></div>
<div id="goodsuctDetail" class="goodsuct_detail">
<div class="goods_name">   <%=proname %> </div>
<div class="goods_num"> 产品编号： <span id="spangoodsuctId"><%=procode %></span></div>
<div class="shim_line"></div>
<div  class="clear"></div> 
<div class="insturction">
<%= Instruction %>  
</div>
<div class="goods_price">
<div class="dfj">所需福点数：</div>
<div class="dd"></div>
<div id="goods_price" class="high"><%=price %>福点</div>
<div class="dfj">库存数：</div>
<div class="dd"><%=proku1%>件</div>
</div>
<div class="goods_stars">
<div class="tag">评价得分：  </div>
<div class="stars">
<%= SbStarHtml%>  &nbsp; 
</div>
<span>共有<%=SCommentCount%>人评分</span>
</div>

<div class="goods_price">
  <div class="dfj">选择型号：</div>
  <div id="divModelTypeList" class="model">
     <%= SbModelTypeHtml %>
  </div>
</div>


<DIV id="toAddShoppingCart">

<DIV class="goods_number">
<DIV class="tag"><PRE class="pre">购买数量：</PRE></DIV>
<DIV class="num_box">
<DIV class="input_text">
<input id="quantity" class="imeMode" name="quantity" value="1" type="text"></div>
<DIV class="input_ctrl"><A class="up" href="javascript:void(0);"></A><A class="down" 
href="javascript:void(0);"></A></DIV></DIV></DIV>
<DIV class="goods_from">
<DIV class="tag"><em> 配送方式：</em></DIV>
<DIV class="delivery_template"><%= DeliveryTemplateName%></DIV>

  
  </DIV>
  <div class="clear"></div>

  <div class="goods_submit">
   <asp:ImageButton ID="ibtnSubmit" runat="server" ImageUrl="images/pro_view_52.png"  />
                          &nbsp;
     <asp:ImageButton ID="ibtnSubmitGenerate" runat="server" ImageUrl="images/pro_view_53.png"  />
   </div>
</DIV>



</div></div>
</div>
 
</div>
<center>
  <table>
   <tr>
   <td style="width:220px; vertical-align:top; float:left; text-align:left;"> 
       <uc6:leftRelationGoods ID="leftRelationGoods1" runat="server" />
       <uc7:leftHotGoods ID="leftHotGoods1" runat="server" />
   </td>
   <td style="vertical-align:top; width:800px; ">
   	<iframe  name="conb" src="products_detfrm.aspx?gid=<%=Request.QueryString["gid"] %>&ccount=<%= SCommentCount %>" frameBorder=0  width="100%" scrolling="no" onload="this.height=conb.document.body.scrollHeight"></iframe>
   </td>
   </tr>
   </table>


   </center>

 <br />
          <input type="hidden" name="score" id="score"  value="<%=proscore %>" />
          <input name="gid" id="gid" type="hidden" value="<%=Request.QueryString["gid"] %>" />
          <input type="hidden" name="price" id="price" value="<%=price %>" />
         <input type="hidden" name="modelTypeId" id="modelTypeId" value="<%= SModelTypeId %>" />
 <uc3:bottom ID="bottom_1" runat="server" />

</form>
</body></html>

<script type="text/javascript">
  
    jQuery("#add_goodsuct_id").val(jQuery('#goodsuctId').val());
    jQuery("#quantity").numeral();
    jQuery("#quantity").change(function () {
        var stockAmount = parseInt(jQuery('#stockAmount').html());
        var quantity = parseInt(jQuery('#quantity').val());
        if (stockAmount >= 0 && quantity > stockAmount) {
            jQuery('#quantity').val(stockAmount);
        }
    });
    jQuery("#toAddShoppingCart .up").click(function () {
        var numField = jQuery('#quantity');
        var value = 0;
        if (numField.val() != "") {
            value = parseInt(numField.val());
        }
        value++;
        numField.val(value);
        numField.change();
    });
    jQuery("#toAddShoppingCart .down").click(function () {
        var numField = jQuery('#quantity');
        var value = 0;
        if (numField.val() != "") {
            value = parseInt(numField.val());
        }
        if (value > 0)
            value--;
        numField.val(value);
        numField.change();
    });


    $(function () {
        $("#ibtnSubmit").click(function () {
            $.ajax({
                type: "POST",
                url: "/isAddToAccountHandler.ashx",
                data: "gid=" + $("#gid").val() + "&price=" + $("#price").val() + "&pronum=" + $("#quantity").val() + "&content=" + $("#content").val() + "&score=" + $("#score").val() + "&useway=1&modeltypeid="+$("#modelTypeId").val(),
                success: function (msg) {

                    if (msg == "1002") {
                        TB_show(null, "/cn/exchange.aspx?TB_iframe=true&height=370&width=640", false);

                    }
                  else  if (msg == "1003") {
                      art.dialog.tips("与购物车商品配送方式不同，请分别提交订单！", 5.0);

                    }
                    else
                        window.location = "/cn/account.aspx";
                }
            });
            return false;
        });

    });

    $(function () {
        $("#ibtnSubmitGenerate").click(function () {
            $.ajax({
                type: "POST",
                url: "/isAddToAccountHandler.ashx",
                data: "gid=" + $("#gid").val() + "&price=" + $("#price").val() + "&pronum=" + $("#quantity").val() + "&content=" + $("#content").val() + "&score=" + $("#score").val() + "&useway=0&modeltypeid=" + $("#modelTypeId").val(),
                success: function (msg) {
                    if (msg == "1002") {
                        TB_show(null, "/cn/login.aspx?TB_iframe=true&height=370&width=640", false);
                    }
                    else if (msg == "1003") {
                        art.dialog.tips("与购物车商品配送方式不同，请分别提交订单！", 5.0);

                    }
                    else
                        window.location = "/cn/account.aspx";
                }
            });
            return false;
        });

    });

    </script>



<script src="/js/jquery.jqzoom.js"></script>

<script type=text/javascript>
    //jQuery.noConflict();
    function initZoom() {
        jQuery("img.jqzoom").jqueryzoom({
            xzoom: 400,
            yzoom: 300,
            offset: 15,
            position: "right"
        });
    }

  </script>
  <script type="text/javascript">
      jQuery(function () {
          setPicSlider();
      });

      function setModelType(id,points) {

          $("#divModelTypeList").children().attr("class", "list");
          $(id).attr("class", "list_select");
          $("#goods_price").html(points + "福点");
          $("#price").val(points);
          $("#modelTypeId").val(id);
      }

    </script>


